package com.his.util;

public class StringToTrimUtil {

    /**
     * 去除字符串两端的空格和空字符，判断是否为空
     * @param s 待判断字符串
     * @return
     */
    public static boolean StringToTrim(String s){

        String ss = s.trim();
        while (ss.startsWith("　")) {   //判断是不是全角空格
            ss = ss.substring(1,ss.length()).trim();
        }
        while (ss.endsWith("　")) {
            ss = ss.substring(0, ss.length() - 1).trim();
        }
        System.out.println(ss);
        if(ss.length()==0) return false;
        return true;
    }

    /**
     * 去除字符串两端的空格和空字符
     * @param s 待判断字符串
     * @return
     */
        public static String StringToString(String s){

        String ss = s.trim();
        while (ss.startsWith("　")) {   //判断是不是全角空格
            ss = ss.substring(1,ss.length()).trim();
        }
        while (ss.endsWith("　")) {
            ss = ss.substring(0, ss.length() - 1).trim();
        }
        return ss;
    }
}
